package com.site.mapper;

import com.night.common.entity.logistical.Area;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ClassName: AreaMapper
 * @author: LJC
 * @date: 2022/10/20-10:40
 * 场地表
 */
public interface AreaMapper {
    //查询所有场地信息
    List<Area> getAll();

    //根据id查询场地信息
    Area getAreaById(Area area);

    //增加场地信息
    @Insert("INSERT INTO ss_area (id,area_type,area_position,area_floor,area_detail,hold_people,area_state) VALUE (#{id},#{areaType},#{areaPosition},#{areaFloor},#{areaDetail},#{holdPeople},#{areaState})")
    void addArea(Area area);

    //修改
    void updateArea(Area area);

    //逻辑删除
    void delAreaById(Area area);

    //根据场地类型查找
    @Select("SELECT * FROM ss_area WHERE area_type = #{areaType}")
    List<Area> getAreaByareaType(Area area);
}
